<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <title>商品展示页</title>
</head>
<body>
<?php 
	include_once("header.php");
	$row = db_get_row("select * from goods where id=".$_REQUEST["id"]);
	db_query("update goods set apv=apv+1 where id=".$_REQUEST["id"]);
	$cat_title = "商品中心";
?>
<div class="m_ctr">
    <div class="ej_tctr">当前位置：<a href="index.php">首页</a> > <?php echo $cat_title;?></div>
    <div class="m_ctr1">
        <div class="m_ctr">
            <div class="gs_ctr1">
				<img src="./Public/Upload/<?php echo $row["img"];?>">
			</div>
            <div class="gs_ctr2">
                <div class="gs_t1">
					<?php echo $row["title"];?>
				</div>
				<div class="gs_t2">新旧：<?php echo $row["mark1"];?></div>
                <div class="gs_t3">
					<div class="gs_t31">
						￥<span id="m_dzprice"><?php echo $row["sprice"];?></span> 
						<span class="span1">￥<?php echo $row["mprice"];?></span>
					</div>
                    <div class="gs_t32">
						库存 <span id="m_stock"><?php echo $row["amount"];?></span> 件
					</div>
                </div>
                <form action="addcart.php" method="post">
					<input type="hidden" value="<?php echo $row["id"];?>" name="goodsid" />
                        <div class="m_ctr" style="line-height:30px; padding-top:5px;">数量：</div>
                        <div class="m_ctr">
                            <div class="cart">
								<div class="cart_num">
									<div class="amount">
										<span class="reduc">&nbsp;-&nbsp;</span>
										<input name="sums" type="text" value="1" />
										<span class="add">&nbsp;+</span>
										<span class="clear"></span>
									</div>
									<div class="soldnum"></div>
								</div>
								<div class="cart_bnt">
                            </div>
                        </div>
							
                        <div class="m_ctr" style="padding-top:10px;">卖家:
						<font color="#e53c53">
							<a href="usershow.php?userid=<?php echo $row["userid"];?>">
							<?php echo db_get_val("user",$row["userid"],"nickname");?>
							</a>
						</font>
						</div>
                        <div class="m_ctr">
                            <script type="text/javascript" src="./Public/js/js.js"></script>
							<input type="submit" class="gwc_btn" value="加入购物车">
							<a href="collect.php?id=<?php echo $row["id"];?>">
								<input type="button" class="gwc_btn" value="加入收藏">
							</a>
                        </div>
                    </div>
				</form>
			</div>
		</div>
	</div>
    <div class="m_ctr">
        <div class="gs_t4">
            <div class="gs_tt4">
                <div class="gs_t42" id="st1" onclick="ctab(1);">图文详情</div>
            </div>
        </div>
        <div class="m_ctr">
            <div class="gs_ctt4" id="stab1"><?php echo $row["content"];?></div>
            <div class="gs_ctt4" id="stab3" style="display:none;"></div>
            <div class="gs_ctt4" id="stab4" style="display:none;"></div>
        </div>
    </div>
</div>
<script language="javascript">
function ctab(id){
	for (var i=1;i<5;i++){
		$("#st"+i).attr("class","gs_t41");
		$("#stab"+i).hide();
	}
	$("#st"+id).attr("class","gs_t42");
	$("#stab"+id).show();
}
</script>
<?php
	include_once("footer.php");
?>
</body>
</html>